GetLicenseXML

SoftwareShield COM-Activator™ Component> COM-Activator™ Reference > GetLicenseXML

## GetLicenseXML

The GetLicenseXML function returns an XML document describing the referenced license projects Authorization Definitions.

###### Syntax

HRESULT GetLicenseXML ( BSTR LPJFileNamePath, long * ACG_return_code, BSTR * LicenseXML );

###### Parameters

LPJFileNamePath

[IN] This is a string value in which you must pass the full path to the license project file you wish to retrieve information on.

###### Remarks

Use GetLicenseXML to get the list of Authorization Definitions for a specified license as an XML document.

The ACG_return_code will return holding the outcome of the operation. (see: ACG_RETURN_CODES)

The ACG_return_code parameter will return holding ACG_FALSE_MISSING_MAIN_LF if the LPJFileNamePath parameter does not indicate a file that exists. If the license project file exists, but is an invalid filename, it returns holding ACG_FALSE_BAD_MAIN_LF_FILENAME. If the License project exists and seems to be the correct format but an error occurred during loading it returns holding ACG_FALSE_MAIN_LF_CORRUPT.

If the license project is successfully loaded, the XML document is constructed and returned in LicenseXML and ACG_return_code will return holding ACG_TRUE_FORMAT_OK.

### XML Schema

If the call is successful, the XML document returned in LicenseXML will have the a schema described by the following DTD:

<!ELEMENT ACGLicense (AuthDefinitions)>
<!ELEMENT AuthDefinitions (AuthDef*)>
<!ELEMENT AuthDef (TypeCode, Description, ParamTypeCode, ParameterDescription, PreSetParameterValue, ShelfLife, SingleUse, Password, DesignTimePayload, PreConditionID )>
<!ELEMENT TypeCode (#PCDATA)>
<!ELEMENT Description (#PCDATA)>
<!ELEMENT ParamTypeCode (#PCDATA)>
<!ELEMENT ParameterDescription (#PCDATA)>
<!ELEMENT PreSetParameterValue (#PCDATA)>
<!ELEMENT ShelfLife (#PCDATA)>
<!ELEMENT SingleUse (#PCDATA)>
<!ELEMENT Password (#PCDATA)>
<!ELEMENT DesignTimePayload (#PCDATA)>
<!ELEMENT PreConditionID (#PCDATA)>
<!ATTLIST ACGLicense ProjectFileName CDATA #REQUIRED>
<!ATTLIST AuthDefinitions Count CDATA #REQUIRED>
<!ATTLIST AuthDef ID CDATA #REQUIRED>

An example document might look like this:

<?xml version="1.0"?>
<ACGLicense ProjectFileName="C:\testdir\LicenseV5_1.lpj">
<AuthDefinitions Count="2">
<AuthDef ID="0">
<TypeCode>1005</TypeCode>
<Description>cp</Description>
<ParamTypeCode>2004</ParamTypeCode>
<ParameterDescription></ParameterDescription>
<PreSetParameterValue>0</PreSetParameterValue>
<ShelfLife>10</ShelfLife>
<SingleUse>False</SingleUse>
<Password>reveals_@_guesswork_4_merging</Password>
<DesignTimePayload></DesignTimePayload>
<PreConditionID>-1</PreConditionID>
</AuthDef>

<AuthDef ID="1">
<TypeCode>1006</TypeCode>
<Description>rec</Description>
<ParamTypeCode>2004</ParamTypeCode>
<ParameterDescription></ParameterDescription>
<PreSetParameterValue>0</PreSetParameterValue>
<ShelfLife>10</ShelfLife>
<SingleUse>True</SingleUse>
<Password>reveals_@_guesswork_4_merging</Password>
<DesignTimePayload></DesignTimePayload>
<PreConditionID>-1</PreConditionID>
</AuthDef>
</AuthDefinitions>
</ACGLicense>

###### Return Value

As with all COM function calls they return an HRESULT. HRESULT is a data type that is a 32-bit error or warning code. Check your compilers documentation for information on interpreting the HRESULT value.

###### Function Information

Exposed By Interface: | "ISSCodeGenerator"
Exposed In COM Server Binary: | "SSCGen.dll"

Note: The COM Activator only comes with the Enterprise, Internet and Server Editions of the SoftwareShield DRM Kit.